package com.xcc.decoratorpattern.demo01;

/**
 * @Description Mocha
 * @Author xiechuang
 * @Date 2022/8/28
 */
public class Mocha extends CondimentDecorator {

    // 装饰者对象
    Beverage beverage;

    public Mocha(Beverage beverage) {
        this.beverage = beverage;
    }

    @Override
    public double cost() {
        return 0.2 + beverage.cost();
    }

    @Override
    public String getDescription() {
        return beverage.getDescription() + ", Mocha";
    }

}
